package com.zd.service;

import com.zd.entity.News;
import com.zd.util.PageUtil;
import org.springframework.data.domain.Page;

import java.util.List;

public interface NewsService {
    public List<News> queryAllNews();

    //根据主题名查询
    public List<News> queryNewsByTname(String tname);
    //根据tid查询
    List<News> queryNewsByTid(Long tid);
    //根据nid查询新闻详细信息
    News queryNewsByNid(Long nid);
    //分页查询新闻
    PageUtil queryNewsByPage(int pageNo);

    //使用sprindata jpa实现分页查询
    Page queryJpaPageNews(int pageNo);
    //判断某主题下是否存在新闻
    boolean isNewsExists(Long tid);

    News addNews(News news);
    //修改新闻
    News updateNews(News news);
    //删除指定新闻和该新闻评论
    void deleteNewsById(Long nid);
}
